package com.lc.pianostudent.conn;

import com.zcx.helper.http.AsyCallBack;
import com.zcx.helper.http.note.HttpInlet;

import org.json.JSONObject;

import java.io.File;

/**
 * Created by Administrator on 2018/2/22.
 */
@HttpInlet(Conn.UPLOADAVATAR)
public class PostUploadAvatar extends BaseAsyPost {

    public String user_id;
    public File image;
    public PostUploadAvatar(AsyCallBack asyCallBack) {
        super(asyCallBack);
    }

    @Override
    protected PostUploadAvatarInfo parser(JSONObject object) throws Exception {
        if (object.optString("code").equals("200")) {

            PostUploadAvatarInfo info = new PostUploadAvatarInfo();

            info.code = object.optString("code");
            info.message = object.optString("message");
            info.data = object.optString("data");


            TOAST = object.optString("message");
            return info;

        } else {

            TOAST = object.optString("message");

        }

        return null;
    }

    public static class PostUploadAvatarInfo {

        public String code, message,data;


    }

}
